{% extends "base.html" %}

{% block head-title %}{{ algorithm.algorithm_name }}{% endblock %}

{% block title %}{{ algorithm.algorithm_name }}{% endblock %} 

{% block content %}
<script src="/static/js/data_visualization/2.js"></script>
<form action="/data_visualization/understand_data_set/" method="post" class="uk-form" id="form1"
					onsubmit="return onForm1Submit();">
	{%csrf_token%}
	<input type="hidden" name="instance_id" value="{{ algorithm.instance_id }}"/>
	<fieldset>
		<legend>理解数据(2/3)</legend>
		
		{% ifequal algorithm.algorithm_name "简单图表" %}
		<div class="uk-form-row">
			<span class="uk-form-label">X轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="xAxis_name" name="xAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name" name="yAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "简单Matplotlib图表" %}
		<div class="uk-form-row">
			<span class="uk-form-label">X轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="xAxis_name" name="xAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name" name="yAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "复合图表" %}
		<div class="uk-form-row">
			<span class="uk-form-label">X轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="xAxis_name" name="xAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴(1)</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name_1" name="yAxis_name_1" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴(2)</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name_2" name="yAxis_name_2" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "复合Matplotlib图表" %}
		<div class="uk-form-row">
			<span class="uk-form-label">X轴</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="xAxis_name" name="xAxis_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴(1)</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name_1" name="yAxis_name_1" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">Y轴(2)</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="yAxis_name_2" name="yAxis_name_2" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
		
		{% ifequal algorithm.algorithm_name "地图标注" %}
		<div class="uk-form-row">
			<span class="uk-form-label">标题</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="title_name" name="title_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">经度</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="lng_name" name="lng_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">纬度</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="lat_name" name="lat_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
		{% ifequal algorithm.algorithm_name "热力图" %}
		<div class="uk-form-row">
			<span class="uk-form-label">数值</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="value_name" name="value_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">经度</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="lng_name" name="lng_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		
		<div class="uk-form-row">
			<span class="uk-form-label">纬度</span>
			<div class="uk-form-controls">
				{% for column in algorithm.data_source.columns.values %}
				<label><input type="radio" id="lat_name" name="lat_name" value="{{column}}">{{column}}</label>
				{% endfor %}
			</div>
		</div>
		{% endifequal %}
	</fieldset>
	<div class="uk-form-row" style="margin-top:5px;">
		<a href="javascript:history.go(-1);" class="uk-button">上一步</a>
		<input class="uk-button uk-button-primary" type="submit"
			value="下一步" style="float: right;">
	</div>
</form>

<hr />
<div style="float: right;">
	<a href="/static/{{algorithm.instance_id}}/{{algorithm.data_source_name}}"
		class="uk-button uk-button-success uk-button-mini" target="_blank">导出</a>
</div>
<table class="uk-table uk-table-striped">
	<caption>记录数:{{algorithm.data_source_size}}</caption>
	<thead>
		<tr>
			<th>序号</th> 
			{% for column in algorithm.data_source.columns %}
			<th>{{ column }}</th> 
			{% endfor %}
		</tr>
	</thead>
	<tbody>
		{% for values in algorithm.data_source.head.values %}
		<tr>
			<td>{{ forloop.counter }}</td>
			{% for value in values%}
			<td>{{ value }}</td>
			{% endfor %}
		</tr>
		{% endfor %}
	</tbody>
</table>
{% endblock %}